package com.xjj.order.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author zhanghejie
 * @date 2020/7/24 15:47
 */

//使用注解@FeignClient 定义feign客户端 ;
//示例 : 该例子定义了一个feign客户端，将远程服务http://test-service/test/echo映射为一个本地Java方法调用。
@FeignClient(value = "stock-service", fallback = StockServiceFeignFallBack.class)
public interface StockServiceFeign {

    @GetMapping(value = "/reduce/{num}")
    public String reduce(@PathVariable(value = "num") Integer num);
}
